<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h1>WebSocket</h1>
</body>
<script>
    var wsUrl = "ws://live.dickycai.top:8812";
    var websocket=new WebSocket(wsUrl);
    websocket.onopen=function (evt) {
        websocket.send('hello world');
        console.log('open');
    };
    websocket.onmessage=function (evt) {
        console.log(evt);
    };
    websocket.onclose=function (evt) {
        console.log(evt);
    }
</script>
</html>